package com.cyc.basic.test.thread;

/**
 * @author chenyunchang
 * @title 实现Runnable的方法
 * @date 2021/4/15 10:17
 * @Description:
 */
public class MyRunnable implements Runnable {

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(i);
        }
    }

    public static void main(String[] args) {
        MyRunnable r1 = new MyRunnable();

        r1.run();
//        r2.run();
        Thread t1 = new Thread(r1);
        Thread t2 = new Thread(r1);
        t1.start();
        t2.start();
    }
}
